﻿<Page x:Class="JasRibbonApplicatie.Views.BeheerMateriaal"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      mc:Ignorable="d" 
      d:DesignHeight="857" d:DesignWidth="611"
	Title="BeheerMateriaal">
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <TreeView ItemsSource="{Binding}" Grid.RowSpan="2" Grid.Column="0" Margin="20" Name="materiaalTreeView" SelectedItemChanged="materiaalTreeView_SelectedItemChanged" HorizontalAlignment="Left">
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Path=ToebehorenTypes}">

                    <!-- Display the MateriaalTypeMetToebehorenType by showing it's naam string -->
                    <TextBlock FontWeight="Bold" Text="{Binding Path=naam}" />

                    <!-- Specify the nested template for the individual toebehorentype items
                    that are within the MateriaalType -->
                    <HierarchicalDataTemplate.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=naam}">
                                <TextBlock.ContextMenu>
                                    <ContextMenu x:Name="DeleteToebehoren">
                                        <MenuItem Header="delete" Click="DeleteMenuItem_Click">
                                            <MenuItem.Icon>
                                                <Image Height="15" Width="15" Source="/JasRibbonApplicatie;component/Images/delete.png"/>
                                            </MenuItem.Icon>
                                        </MenuItem>
                                    </ContextMenu>
                                </TextBlock.ContextMenu>
                            </TextBlock>
                        </DataTemplate>
                    </HierarchicalDataTemplate.ItemTemplate>
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>
        <Label Grid.Column="1" Grid.Row="0" Content="Overzicht materiaal" Height="28" HorizontalAlignment="Left" Margin="12,12,0,0" Name="label1" VerticalAlignment="Top" Width="130"/>
        <Frame Grid.Column="1" Grid.Row="1" Margin="10,10,10,10" Name="overzichtFrame" HorizontalAlignment="Stretch" />
    </Grid>
</Page>
